<template>
    <div class="placeholder"></div>

    <div class="top">
        <van-nav-bar
            :title="title"
            left-text="返回"
            left-arrow
            @click-left="leftHandle"
        />
    </div>
</template>

<script setup lang="ts">
import {useRoute} from "vue-router";
import {ref} from "vue";

// 实例化路由
const route = useRoute()

// 标题
const title = ref<string>(route.meta.title)

// 点击左按钮 回调
const leftHandle = () => {
    history.back()
}
</script>

<style scoped lang="less">
.placeholder {
    height: 50px;
}

.top {
    position: fixed;
    top: 0px;
    width: 100vw;
    z-index: 99999;
}
</style>